Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable NPD to run as a Windows Service. #541

Merged
merged 1 commit into from
Apr 6, 2021
Merged

Enable NPD to run as a Windows Service. #541

merged 1 commit into from
Apr 6, 2021

Conversation

jeremyje
Copy link
Contributor

The change allows NPD to run as a Windows Service. This is similar to a systemd service on Linux but Windows services allow for control states (pause, continue, etc).
This implementation only allows for running and stopped states since there's no benefit to add support for paused.
To run NPD as a Windows Service you must use the service control, sc.exe, to install it, instructions added to the readme. NPD will not support the notion of --register-service given how it processes flags and the complexity of making this work does is not worth it.

Lastly, since this is a significant change to the main loop for NPD, unit tests have been added to catch future regressions.

See #461 for Windows Support and design.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 16, 2021
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 16, 2021
@jeremyje
Copy link
Contributor Author

/sig node
/sig windows
/priority important-soon

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Mar 17, 2021
@jeremyje
Copy link
Contributor Author

/cc mcshooter

@k8s-ci-robot
Copy link
Contributor

@jeremyje: GitHub didn't allow me to request PR reviews from the following users: mcshooter.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc mcshooter

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dchen1107
Copy link
Member

/assign @chardch

Richard, can you help review this PR? Please let me and Lantao know if you need more help here. Thanks!

Copy link

@chardch chardch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me. I left a couple clarifying questions

@jeremyje
Copy link
Contributor Author

jeremyje commented Apr 1, 2021

Thanks Richard for the review!

Ping others for review. cc: @liyanhui1228

Copy link

@liyanhui1228 liyanhui1228 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@liyanhui1228
Copy link

Looks like we still need @wangzhen127 for owner approval.

/assign @wangzhen127

@liyanhui1228
Copy link

/assign @Random-Liu

@Random-Liu
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 3, 2021
Copy link
Member

@Random-Liu Random-Liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not sure I missed any files.

I saw some unused code. Could you clean them up?

cmd/nodeproblemdetector/node_problem_detector.go Outdated Show resolved Hide resolved
cmd/options/options.go Outdated Show resolved Hide resolved
cmd/nodeproblemdetector/node_problem_detector.go Outdated Show resolved Hide resolved
cmd/nodeproblemdetector/node_problem_detector.go Outdated Show resolved Hide resolved
@Random-Liu
Copy link
Member

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 3, 2021
@jeremyje
Copy link
Contributor Author

jeremyje commented Apr 3, 2021

@Random-Liu Cleaned up the code should be good now.

@Random-Liu
Copy link
Member

/lgtm
/unhold
/approve

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 6, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 6, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chardch, jeremyje, liyanhui1228, Random-Liu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jeremyje
Copy link
Contributor Author

jeremyje commented Apr 6, 2021 via email

@k8s-ci-robot k8s-ci-robot merged commit fc0edbd into kubernetes:master Apr 6, 2021
@jeremyje jeremyje deleted the windowsservice branch April 6, 2021 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants